<?php defined('SYSPATH') OR die('No direct access allowed.'); ?>
<script type="text/javascript">
$(document).ready(function() {
	
	$("#cboGene").change(function() {
		var uri = ISS.lang.getBasePath()+'index.php/admin/gene_member/ajax_page/'+this.value+'/'+1;
		ISS.Ajax.Caller.request(uri, null);
	});
	
}); 
</script>

<?php 	
	echo html::Stylesheet(
		array
		(
			'media/css/gene_block.css',
		),
		array
		(
			'screen',
		)
	);	
?>

<div id="mainCont">
	<h3>รายการสมาชิกที่ชอบแนวเพลง</h3>
	<select style="width:150px"
		id="cboGene"
		name="cboGene">
		<option value="0"></option>
		<?php foreach ($genes as $gene): ?>
		<option value="<?php echo $gene['id']; ?>"><?php echo html::specialchars($gene['name']); ?></option>
	    <?php endforeach ?>	
	    
	</select>
	<div id="geneMember">
		<table>
		    <tr>
		        <th>สมาชิก</th>
		        <th>ประเภท</th>
		    </tr>
		    <?php 
		    	$i = 0;
		    	foreach ($members as $member): 
		    		$i++;
		    		echo (($i % 2)==0) ? '<tr class="geneListDark">' : '<tr class="geneListLight">';
		    ?>
		        <td><?php echo html::specialchars($member->prefix . ' ' . $member->firstname . ' ' . $member->lastname); ?></td>
		        <td><?php echo html::specialchars($member->member_type); ?></td>
		    </tr>
		    <?php endforeach ?>
		</table>
	
		<?php echo $pagination ?>
	</div>
</div>